package events;

import org.bouncycastle.openpgp.PGPPublicKey;

import core.Blog;

/**
 * This event should be thrown when a new PublicKey has been added to a Blog
 * and every AddedPublicKeyListener should be called with it as argument.
 * 
 * @author ole
 */
public class AddedPublicKeyEvent extends BlogEvent {
	// Class constants.
	private static final long serialVersionUID = 1L;
	
	// Class attributes.
	private PGPPublicKey key;
	
	/*
	 * Public methods.
	 */

	/**
	 * Class constructor.
	 */
	public AddedPublicKeyEvent(Blog source, PGPPublicKey key) {
		super(source);
		this.key = key;
	}
	
	/**
	 * Returns the PGPPublicKey associated to this event.
	 * 
	 * @return:
	 * 		The PGPPublicKey recently added.
	 */
	public PGPPublicKey getPublicKey() {
		return key;
	}
}
